import { createRouter, createWebHashHistory } from 'vue-router'
const routerHistory = createWebHashHistory(); // 哈希模式,带#号
import staticRouter from './staticRouter' // 静态路由

const router = createRouter({
    history: routerHistory, //路由模式
    routes: [
        ...staticRouter,  //注册静态路由
    ]
})
export function resetRouter() {
    const newRouter = router;
    (router as any).matcher = (newRouter as any).matcher // reset router
  }
// 这里做路由守卫
// router.beforeEach((to, from, next) => {
//     // 开启进度调
//     NProgress.start();
//     next();
// })

// router.afterEach((t0, from) => {
//     NProgress.done();
// })

export default router;